Skip to content

=spec #384 amend spec to allow not mentioning rule number in exception message #386

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

ktoso
Copy link
Contributor

@ktoso ktoso commented Jul 4, 2017

Resolves spec part of #384 and is follow up / prerequisite for the TCK change: #385

Discussion in: #345 (comment)

This change is compatible with existing implementations, and allows JDK9's interfaces to be compatible with our rules (since that impl won't refer to the number of the rule explicitly)

Resolves #385

@ktoso ktoso mentioned this pull request Jul 4, 2017
README.md Outdated
@@ -183,7 +183,7 @@ public interface Subscription {
| [:bulb:](#3.7 "3.7 explained") | *The intent of this rule is superseded by [3.5](#3.5).* |
| <a name="3.8">8</a> | While the `Subscription` is not cancelled, `Subscription.request(long n)` MUST register the given number of additional elements to be produced to the respective subscriber. |
| [:bulb:](#3.8 "3.8 explained") | *The intent of this rule is to make sure that `request`-ing is an additive operation, as well as ensuring that a request for elements is delivered to the Publisher.* |
| <a name="3.9">9</a> | While the `Subscription` is not cancelled, `Subscription.request(long n)` MUST signal `onError` with a `java.lang.IllegalArgumentException` if the argument is <= 0. The cause message MUST include a reference to this rule and/or quote the full rule. |
| <a name="3.9">9</a> | While the `Subscription` is not cancelled, `Subscription.request(long n)` MUST signal `onError` with a `java.lang.IllegalArgumentException` if the argument is <= 0. The cause message SHOULD explain that non-positive request signals are illegal. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an extraneous space between "cause" and "message".

I guess the question is that if amending this rule should actually be removing the last sentence, since the other rules which mandate exceptions are not requiring rule referencing. Thoughts @reactive-streams/contributors ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see, then in the TCK we should not check the message at all if we want to remove the wording suggestion. It would only check that we got an IllegalArgumentException - which is also OK.

I don't mind either way, I like the suggestion but happy to remove and change the TCK PR to only check exception type.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After some pondering I think just checking exception type is the most compatible thing to do anyway and to actually enforce - so I agree on removing the sentence completely.

Waiting a round of sleep for feedback and addressing those once i wake up :)

@DougLea
Copy link
Contributor

DougLea commented Jul 4, 2017

I think the current proposed wording is OK.
("SHOULD explain that non-positive request signals are illegal.")
This is in keeping with the sentiment that the exception should be helpful in identifying the nature of problem vs many other possible IllegalArgumentExceptions. On the other hand "SHOULD" implies
that the actual conformance check probably shouldn't try to check for any particular wording.

@ktoso
Copy link
Contributor Author

ktoso commented Jul 4, 2017

Fixed the additional space and kept the wording, thanks for chiming in @DougLea !

@viktorklang
Copy link
Contributor

@DougLea @ktoso I agree. Making it a SHOULD is the most sensible option here.

@viktorklang
Copy link
Contributor

@reactive-streams/contributors 1 day left to comment on this!

@viktorklang
Copy link
Contributor

@reactive-streams/contributors Merging.

@viktorklang viktorklang merged commit 1a42607 into reactive-streams:master Jul 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants